package passwordCheckerPrimeiraIteracao.testes;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import passwordCheckerPrimeiraIteracao.PasswordCheckerBasePrimeiraIteracao;

@RunWith(Parameterized.class)
public class DigitCounterTest {
	private Integer numberOfDigits;
	private String inputPassword;

	public DigitCounterTest(String pInputPassword, Integer pNumberOfDigits) {
		this.inputPassword = pInputPassword;
		this.numberOfDigits = pNumberOfDigits;
	}

	@Parameterized.Parameters
	public static Collection digitValidation() {
		return Arrays.asList(new Object[][] { { "Luiz123", 3 }, { "Luiz", 0 },
				{ "1Luiz", 1 }, { "Lu124iz", 3 }, { "12342", 5 } });
	}

	@Test
	public void SymbolValidation() {
		assertEquals(Integer.valueOf(numberOfDigits),
				Integer.valueOf((PasswordCheckerBasePrimeiraIteracao
						.digitCounter(inputPassword))));
	}
}
